#!/bin/sh

echo "making dirs"
mkdir /etc/jsb2
mkdir /var/log/jsb2
chown jsb2:jsb2 /var/log/jsb2
mkdir /var/run/jsb2
chown jsb2:jsb2 /var/run/jsb2
mkdir /var/cache/jsb2
chown jsb2:jsb2 /var/cache/jsb2
mkdir /var/lib/jsb2
chown jsb2:jsb2 /var/lib/jsb2
echo "running setup.py"
python setup-debian.py install
echo "copying files"
cp debian/init.d/jsb2 /etc/init.d/
cp debian/default/jsb2 /etc/default/
cd debian/man
if [ -f jsb2.1 ] ; then gzip *.1
fi
cp *.gz /usr/share/man/man1
echo "done"
